﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VirtualPowerPointController
{
    public partial class AddressSettings : Form
    {
        public String Ip { get { return textBox1.Text; } }
        public int Port { get { return Convert.ToInt32(textBox2.Text); } }
      //  public PerformPing performstring { set; get; }
        public AddressSettings()
        {
            InitializeComponent();
        }

        private void AddressSettings_Load(object sender, EventArgs e)
        {
            textBox1.Text = VirtualPowerPointController.Properties.Settings.Default.Ip;
            textBox2.Text = VirtualPowerPointController.Properties.Settings.Default.Port;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            VirtualPowerPointController.Properties.Settings.Default.Ip = Ip;
            VirtualPowerPointController.Properties.Settings.Default.Port = Port.ToString();
            this.DialogResult = DialogResult.OK;
            this.Hide();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Hide();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            //this.performstring(Ip, Port);
        }
    }
}
